#!/usr/bin/python
#coding: utf-8
#Boa:FramePanel:my_panel

import wx

[wxID_MY_PANEL] = [wx.NewId() for _init_ctrls in range(1)]

class my_panel(wx.Panel):
    type_name="my_panel"
    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Panel.__init__(self, id=wx.NewId(), name=u'my_panel', parent=prnt,
              pos=wx.Point(429, 399), size=wx.Size(200, 100),
              style=wx.TAB_TRAVERSAL)
        self.SetClientSize(wx.Size(192, 66))

    def __init__(self, parent,typename=None, id=None, pos=None, size=None, style=None, name=None):
        self._init_ctrls(parent)
        self.type_name=typename
        
        self.Bind(wx.EVT_RIGHT_DOWN,self.OnRightDown)
        self.Bind(wx.EVT_MENU,self.OnMenuClick,id=4444)
        self.Bind(wx.EVT_MENU,self.OnMenuClick,id=4445)
        
    def OnMenuClick(self,event):
        wx.MessageBox("menuclick")
        
    def OnRightDown(self,event):
        popmenu=wx.Menu()
        popmenu.Append(4444,u'删除')
        popmenu.Append(4445,u'修改')
        
        self.PopupMenu(popmenu,event.GetPosition())

def test():
    app=wx.PySimpleApp()
    fr=wx.Frame(None)
    my_panel(fr)
    fr.Show()
    app.MainLoop()
    
